-
Notifications
You must be signed in to change notification settings - Fork 1.8k
in_systemd: always reset cursor before iterating fields #11073
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughAdded two resets of the systemd journal data cursor/decompression state in the systemd input plugin and set static libzstd visibility to hidden in the bundled zstd CMake build. Changes
Sequence Diagram(s)sequenceDiagram
participant Reader as in_systemd_collect
participant Journal as sd_journal
Note over Reader,Journal #EFEFEF: Per-entry processing (new calls highlighted)
Reader->>Journal: sd_journal_next() / advance to next entry
Reader->>Journal: sd_journal_restart_data() -- reset decompression/cursor
Reader->>Journal: sd_journal_enumerate_data() -- enumerate fields
Reader->>Journal: sd_journal_restart_data() -- ensure fresh enumeration state
alt field data present
Journal-->>Reader: field data items
else no data / end
Journal-->>Reader: no more fields
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20–30 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (2 warnings, 1 inconclusive)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Signed-off-by: Eduardo Silva <[email protected]>
0bd94dd to
2a64814
Compare
|
Added another update to avoid zstd exporting symbols... |
|
note: CI error is with CI Fuzz with credentials (already fixed in master) |
6157556 to
2a64814
Compare
|
Removed the zstd commit. |
Restart the journal data cursor before enumerating the fields. Recent libsystemd releases require callers to reset the cursor between entries; otherwise the internal decompression context can be reused in an invalid state, which ultimately triggers a crash in ZSTD_freeDDict().
Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.
Summary by CodeRabbit